package org.example.pojo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Teacher extends User {
    private int prof = 0;
    private List<Integer> CourseNo = new ArrayList<>();
    private boolean[] teacherTime = new boolean[35];

    public Teacher() { }

    public Teacher(int account, String password, String name, String email, String telenumber, String joindate, int prof, List<Integer> courseNo, boolean[] teacherTime) {
        super(account, password, name, email, telenumber, joindate);
        this.prof = prof;
        CourseNo = courseNo;
        this.teacherTime = teacherTime;
    }

    public int getProf() {
        return prof;
    }

    public void setProf(int prof) {
        this.prof = prof;
    }

    public void setCourseNo(int x,int courseNo) {
        this.CourseNo.add(x, courseNo);
    }//设置所教课程编号

    public List<Integer> getCourseNo() {
        return CourseNo;
    }

    public void setCourseNo(List<Integer> courseNo) {
        CourseNo = courseNo;
    }

    public boolean getTeacherTime(int x) {
        return teacherTime[x];
    }//获取第x时间是否占用

    public void setTeacherTime(int x,boolean b) {
        this.teacherTime[x] = b;
    }//第x个占用为b

    public boolean[] getTeacherTime() {
        return teacherTime;
    }

    public void setTeacherTime(boolean[] teacherTime) {
        this.teacherTime = teacherTime;
    }

    public void setTeacherTime() {
        for(int i=0;i<35;i++)
            teacherTime[i]=false;
    }//初始化没上课

    @Override
    public String toString() {
        return "Teacher{" +
                "prof=" + prof +
                ", CourseNo=" + CourseNo +
                ", teacherTime=" + Arrays.toString(teacherTime) +
                "} " + super.toString();
    }
}
